import {NativeModules,NativeEventEmitter, Platform} from 'react-native'
let OSSModule = NativeModules.OSSModule;
let eventEmitter = new NativeEventEmitter(OSSModule);
class AliOSS{

   static uploadFile(file,cb)
   {
        eventEmitter.removeAllListeners('OSSModule')
        eventEmitter.addListener("OSSModule",cb)
        OSSModule.uploadFile(file)
   }

   static initOSSConfig(config)
   {
      OSSModule.initOSSConfig(config)
   }

   static stopUpload()
   {
      OSSModule.stopUpload()
   }
}

export default  AliOSS
